import { createApp } from 'vue'
import { globalRegister } from './global'

import 'normalize.css'
import './assets/css/index.less'

//全局引入
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// import '@/service/axios.demo'
// import cyRequest from '@/service'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import App from './App.vue'

import router from '@/router'
import store from '@/store'
import { setupStore } from './store'

import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(ElementPlus, {
  locale: zhCn
})
// 注册element-plus/其他
app.use(globalRegister)
setupStore()
app.use(router)
app.use(store)
app.use(ElementPlus, { size: 'small' })

app.mount('#app')

/*
interface DataType {
  data: any
  returnCode: string
  success: boolean
}
 cyRequest
  .request<DataType>({
    url: '/home/multidata',
    method: 'GET',
    showLoading: false
    // interceptors: {
    //   requestInterceptor: (config) => {
    //     console.log('单独的请求的config拦截')
    //     return config
    //   },
    //   responseInterceptor: (res) => {
    //     console.log('单独响应的response')
    //     return res
    //   }
    // }
  })
  .then((res) => {
    console.log(res)
  })
 */
